-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: clock_control: stm32 ll common: fix RCC pll disable #83062
drivers: clock_control: stm32 ll common: fix RCC pll disable #83062
Conversation
Hello @bbyers-UBCO, and thank you very much for your first pull request to the Zephyr project! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bbyers-UBCO !
Please fix the compliance issues reported by ci here.
/* Disable PLL */ | ||
LL_RCC_PLL_Disable(); | ||
while (LL_RCC_PLL_IsReady() != 0U) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix indentation (we're using 8 char tabs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Also added the LL_RCC_PLL2_IsReady() check as @FRASTM mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing that
LGTM after formatting the code
Probably that control loop should also apply anywhere a PLL is being disabled by LL_RCC_PLL1_Disable() or LL_RCC_PLL2_Disable() before any access to the PLL config register.
b070786
to
9294bae
Compare
The clock_stm32_ll_common.c function set_up_plls calls LL_RCC_PLL_Disable();and it was not waiting for the disable to complete before trying to configure the pll sysclock which creates a race condition for pll configuration.The wait for re-enabling the RCC pll is already there, it was just missing the wait for the disable before configuration. Also added the wait for PLL2. Signed-off-by: Benjamin Curtis Byers <[email protected]>
9294bae
to
dab97f7
Compare
Hi @bbyers-UBCO! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
The clock_stm32_ll_common.c function set_up_plls calls LL_RCC_PLL_Disable(); and it was not waiting for the disable to complete before trying to configure the pll sysclock which creates a race condition for pll configuration. The wait for re-enabling the RCC pll is already there, it was just missing the wait for the disable before configuration.